#pragma once

#include "interfaces.h"
#include <vector>

namespace Proton 
{
	namespace Managers
	{
		class PlatformManager;
		class GraphicsManager;

		class PScheduler
		{
			static std::vector<IInitializable*> initializableModules;
			static std::vector<ILoadable*> loadableModules;
			static std::vector<IUpdateable*> updateableModules;
			static std::vector<IRenderable*> renderableModules;

			PlatformManager* pPlatform;
			GraphicsManager* pGraphics;

			bool _loop;
		public:
			PScheduler();
			~PScheduler();
			
			static void registerModule(IInitializable*);
			static void registerModule(ILoadable*);
			static void registerModule(IUpdateable*);
			static void registerModule(IRenderable*);

			void initializeModules();
			void loadContentOfModules();
			void initialize(PlatformManager* _pPlatform, GraphicsManager* _pGraphics);

			int loop();
			void quit();
		};
	}
}
